import { Engine, SceneLoader } from '@babylonjs/core';
import '@babylonjs/inspector';
import { EventDispatch } from './base/EventDispatch';
import { World } from './World';


interface Web3dEvent {
    'Add': number,
    "Remove": string;
}
class Web3D extends EventDispatch<Web3dEvent> {

    private engine: Engine;
    private world: World;

    constructor(canvas: HTMLCanvasElement) {
        super();
        this.addEventListener('Add', this.log);
    }


    eventTest() {

    }
    log(n: number) {
        console.log(n);
    }

}
export let web3D: Web3D;
export function init(canvas: HTMLCanvasElement) {
    if (web3D == null) {
        web3D = new Web3D(canvas);
    }
    return web3D;
}
